<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateScheduleGenrePivotTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('schedule_genre_pivot', function (Blueprint $table) {
        	$table->unsignedInteger('schedule_id')->index();
        	$table->unsignedInteger('genre_id')->index();
        	$table->unsignedInteger('staff')->comment('人数');
			$table->primary(['schedule_id', 'genre_id']);
			$table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('schedule_genre_pivot');
    }
}
